package zj.it.bhne.gridengineeringsurvey.myutils.map_activity;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import zj.it.bhne.gridengineeringsurvey.R;

/**
 * Created by Jiang on 2019/2/28
 */
public class GetImages {
    private static final GetImages ourInstance = new GetImages();

    public static GetImages getInstance() {
        return ourInstance;
    }

    private GetImages() {
    }
    
    private Context activity;

    private Bitmap getImage(int path){
        return BitmapFactory.decodeResource(activity.getResources(),path);
    }
    
    public Bitmap getImage(Context activity, String old, String name) {
        this.activity = activity;
        switch (old) {
            case "新建":
                switch (name) {
                    case "直线杆":
                        getImage(R.drawable.x_zxg);
                        break;
                    case "转角杆":
                        getImage(R.drawable.x_zjg);
                        break;
                    case "耐张杆":
                        getImage(R.drawable.x_nzg);
                        break;
                    case "终端杆":
                        getImage(R.drawable.x_zdg);
                        break;
                    case "柱上变压器":
                        getImage(R.drawable.x_zjz);
                        break;
                    case "配电室":
                        getImage(R.drawable.x_pds);
                        break;
                    case "环网箱":
                        getImage(R.drawable.x_hwx);
                        break;
                    case "开关站":
                        getImage(R.drawable.x_kgz);
                        break;
                    case "环网室":
                        getImage(R.drawable.x_hws);
                        break;
                    case "箱式变":
                        getImage(R.drawable.x_xsb);
                        break;
                    case "电缆分支箱":
                        getImage(R.drawable.x_dlf);
                        break;
                    case "变电站":
                        getImage(R.drawable.x_bdz);
                        break;
                    case "电缆井":
                        getImage(R.drawable.x_dlj);
                        break;
                    case "电缆拐点":
                        getImage(R.drawable.x_gd);
                        break;
                    case "通讯线":
                        getImage(R.drawable.x_dxd);
                        break;
                    case "高低压线":
                        getImage(R.drawable.x_dxd);
                        break;
                    case "道路":
                        getImage(R.drawable.x_dxd);
                        break;
                    case "河流":
                        getImage(R.drawable.x_dxd);
                        break;
                    case "建筑物":
                        getImage(R.drawable.x_dxd);
                        break;
                    default:
                        getImage(R.drawable.x_dxd);
                        break;
                }
                break;
            case "原有":
                switch (name) {
                    case "直线杆":
                        getImage(R.drawable.y_zxg);
                        break;
                    case "转角杆":
                        getImage(R.drawable.y_zjg);
                        break;
                    case "耐张杆":
                        getImage(R.drawable.y_nzg);
                        break;
                    case "终端杆":
                        getImage(R.drawable.y_zdg);
                        break;
                    case "柱上变压器":
                        getImage(R.drawable.y_zjz);
                        break;
                    case "配电室":
                        getImage(R.drawable.y_pds);
                        break;
                    case "环网箱":
                        getImage(R.drawable.y_hwx);
                        break;
                    case "开关站":
                        getImage(R.drawable.y_kgz);
                        break;
                    case "环网室":
                        getImage(R.drawable.y_hws);
                        break;
                    case "箱式变":
                        getImage(R.drawable.y_xsb);
                        break;
                    case "电缆分支箱":
                        getImage(R.drawable.y_dlf);
                        break;
                    case "变电站":
                        getImage(R.drawable.y_bdz);
                        break;
                    case "电缆井":
                        getImage(R.drawable.y_dlj);
                        break;
                    case "电缆拐点":
                        getImage(R.drawable.y_gd);
                        break;
                    case "通讯线":
                        getImage(R.drawable.y_dxd);
                        break;
                    case "高低压线":
                        getImage(R.drawable.y_dxd);
                        break;
                    case "道路":
                        getImage(R.drawable.y_dxd);
                        break;
                    case "河流":
                        getImage(R.drawable.y_dxd);
                        break;
                    case "建筑物":
                        getImage(R.drawable.y_dxd);
                        break;
                    default:
                        getImage(R.drawable.y_dxd);
                        break;
                }
                break;
            case "改造":
                switch (name) {
                    case "直线杆":
                        getImage(R.drawable.g_zxg);
                        break;
                    case "转角杆":
                        getImage(R.drawable.g_zjg);
                        break;
                    case "耐张杆":
                        getImage(R.drawable.g_nzg);
                        break;
                    case "终端杆":
                        getImage(R.drawable.g_zdg);
                        break;
                    case "柱上变压器":
                        getImage(R.drawable.g_zjz);
                        break;
                    case "配电室":
                        getImage(R.drawable.g_pds);
                        break;
                    case "环网箱":
                        getImage(R.drawable.g_hwx);
                        break;
                    case "开关站":
                        getImage(R.drawable.g_kgz);
                        break;
                    case "环网室":
                        getImage(R.drawable.g_hws);
                        break;
                    case "箱式变":
                        getImage(R.drawable.g_xsb);
                        break;
                    case "电缆分支箱":
                        getImage(R.drawable.g_dlf);
                        break;
                    case "变电站":
                        getImage(R.drawable.g_bdz);
                        break;
                    case "电缆井":
                        getImage(R.drawable.g_dlj);
                        break;
                    case "电缆拐点":
                        getImage(R.drawable.g_gd);
                        break;
                    case "通讯线":
                        getImage(R.drawable.g_dxd);
                        break;
                    case "高低压线":
                        getImage(R.drawable.g_dxd);
                        break;
                    case "道路":
                        getImage(R.drawable.g_dxd);
                        break;
                    case "河流":
                        getImage(R.drawable.g_dxd);
                        break;
                    case "建筑物":
                        getImage(R.drawable.g_dxd);
                        break;
                    default:
                        getImage(R.drawable.g_dxd);
                        break;
                }
                break;
            case "删除":
                switch (name) {
                    case "直线杆":
                        getImage(R.drawable.c_zxg);
                        break;
                    case "转角杆":
                        getImage(R.drawable.c_zjg);
                        break;
                    case "耐张杆":
                        getImage(R.drawable.c_nzg);
                        break;
                    case "终端杆":
                        getImage(R.drawable.c_zdg);
                        break;
                    case "柱上变压器":
                        getImage(R.drawable.c_zjz);
                        break;
                    case "配电室":
                        getImage(R.drawable.c_pds);
                        break;
                    case "环网箱":
                        getImage(R.drawable.c_hwx);
                        break;
                    case "开关站":
                        getImage(R.drawable.c_kgz);
                        break;
                    case "环网室":
                        getImage(R.drawable.c_hws);
                        break;
                    case "箱式变":
                        getImage(R.drawable.c_xsb);
                        break;
                    case "电缆分支箱":
                        getImage(R.drawable.c_dlf);
                        break;
                    case "变电站":
                        getImage(R.drawable.c_bdz);
                        break;
                    case "电缆井":
                        getImage(R.drawable.c_dlj);
                        break;
                    case "电缆拐点":
                        getImage(R.drawable.c_gd);
                        break;
                    case "通讯线":
                        getImage(R.drawable.c_dxd);
                        break;
                    case "高低压线":
                        getImage(R.drawable.c_dxd);
                        break;
                    case "道路":
                        getImage(R.drawable.c_dxd);
                        break;
                    case "河流":
                        getImage(R.drawable.c_dxd);
                        break;
                    case "建筑物":
                        getImage(R.drawable.c_dxd);
                        break;
                    default:
                        getImage(R.drawable.c_dxd);
                        break;
                }
                break;
        }
        
        return null;
    }
    
}
